package com.qidian.k12.controller;

import com.qidian.k12.pojo.TestScore;
import com.qidian.k12.service.TestScoreService;
import com.qidian.k12.util.K12Result;
import com.qidian.k12.util.ObjectTools;
import com.qidian.k12.vo.TestScoreQueryVo;
import com.qidian.k12.vo.TestScoreSaveVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (TestScore)表控制层
 *
 * @author makejava
 * @since 2021-10-28 09:02:10
 */
@RestController
@RequestMapping("testScore")
public class TestScoreController {
    /**
     * 服务对象
     */
    @Resource
    private TestScoreService testScoreService;

    @RequestMapping("/detail")
    public K12Result detail(long scoreId){
        return testScoreService.queryDetail(scoreId);
    }


    @PostMapping("/query")
    public K12Result query(@RequestBody TestScoreQueryVo vo){
        return testScoreService.queryByPager(ObjectTools.object2map(vo));
    };

    @PostMapping("/save")
    public K12Result save(@RequestBody TestScoreSaveVo vo){
        return testScoreService.save(vo);
    }

}

